#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <rpgx>

new upgrade_id;

public plugin_init(){
	register_plugin("LongJump RPGx Upgrade", "2.1", "roflmao456");
	RegisterHam(Ham_Player_Jump, "player", "PlayerJump", 1);
	}

public RPGx_OnPluginReady()
	upgrade_id = RPGx_MakeUpgrade("LongJump", 5, 20, 15);

public PlayerJump(id){
	if(is_user_alive(id)){
		new level = RPGx_GetUpgradeLevel(id, upgrade_id);
		if(level && get_entity_flags(id)&FL_ONGROUND){
			new Float:velocity[3];
			velocity_by_aim(id, 250, velocity);
			
			velocity[0] += float(level) * 20;
			velocity[1] += float(level) * 20;
			
			entity_set_vector(id, EV_VEC_velocity, velocity);
			}
		}
	}